﻿@model PagedList<Sample.BusinessEntities.PersonModel>

<p>
    @Html.ActionLink("新增", "Create", null, new { @class = "pull-right mg20" })
</p>
<table id="person_tab" class="table table-hover">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.BirthDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreatedTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreatedBy)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UpdatedTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UpdatedBy)
        </th>

        <th>
            @Html.DisplayNameFor(model => model.VersionNo)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.BirthDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreatedTime)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreatedBy)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdatedTime)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdatedBy)
            </td>

            <td>
                @Html.DisplayFor(modelItem => item.VersionNo)
            </td>
            <td>
                @Html.ActionLink("编辑", "Edit", new { id = item.Id }) |

                @Html.ActionLink("删除", "Delete", new { id = item.Id })
            </td>
        </tr>
    }

</table>
<div>
    <div style="float:left;width:50%">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</div>
    @Ajax.Pager(Model).Options(o => o.SetPageIndexParameterName("page").AddHtmlAttribute("style", "float:right").SetPagerItemTemplate("&nbsp;{0}")).AjaxOptions(a => a.SetUpdateTargetId("personlist").SetDataFormId("searchForm"))
</div>